<!--
  @author heguanghua
  @since 2019/06/12 11:57
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common::jscss"/>
<body>


<div class="layui-fluid">

    <blockquote class="layui-crumb">
        试点配置/
        <zmn th:if="${type == 1}">渠道配置</zmn>
        <zmn th:if="${type == 2}">城市配置</zmn>
    </blockquote>

    <div class="layui-card">

        <div class="layui-tab layui-tab-brief">
            <ul class="layui-tab-title">
                <li th:if="${type == 1}"><a
                        th:href="|/pilot/channel/price/addEditView.action?channelPriceId=${configId}|" lay-text="配置信息">配置信息</a>
                </li>
                <li th:if="${type == 2}"><a th:href="|/pilot/city/toEdit.action?relationId=${configId}|"
                                            lay-text="配置信息">配置信息</a></li>
                <li class="layui-this"><a
                        th:href="|/pilot/channel/price/serviceCategory.action?configId=${configId}&type=${type}&showType=2|"
                        lay-text="应用分类">应用分类</a></li>
            </ul>
        </div>

        <div class="layui-card-body">
            <form method="POST" action="" class="layui-form" lay-filter="zmn-form">

                <input type="hidden" name="configId" th:value="${configId}"/>
                <input type="hidden" name="type" th:value="${type}"/>
                <input type="hidden" name="showType" th:value="${showType}"/>

                <div class="layui-tab layui-tab-brief" lay-filter="servCategId">
                    <ul class="layui-tab-title">
                        <li th:each="servCategory,state:${servCategorys}" th:text="${servCategory.value}"
                            th:lay-id="${servCategory.key}" th:class="${state.index == 0 ? 'layui-this' : ''}"/>
                    </ul>
                    <div class="layui-tab-content">
                        <div th:each="servCategory,state:${servCategorys}"
                             th:class="${state.index == 0 ? 'layui-tab-item layui-show' : 'layui-tab-item'}">
                            <div class="layui-card-body">
                                <div class="inline-block" style="float: left">
                                    <div class="zmn-2layer-list" th:each="oneCateg:${servCategory.children}">
                                        <div class="list-left" style="text-align: center">
                                            <div class="list-item" th:text="${oneCateg.value}"></div>
                                        </div>
                                        <div class="list-right">
                                            <div class="right-box">
                                                <div class="list-item">
                                                    <input type="checkbox" class="checkAll" lay-filter="checkAll"
                                                           th:value="${servCategory.key + '-' + oneCateg.key}"
                                                           title="全选">
                                                </div>
                                                <div class="list-item" th:each="categ:${oneCateg.children}"
                                                     th:title="${categ.value}">
                                                    <input type="checkbox" lay-filter="checkOne" name="categoryId"
                                                           th:class="${servCategory.key + '-' + oneCateg.key}"
                                                           th:value="|${servCategory.key}-${oneCateg.key}-${categ.key}|"
                                                           th:checked="${#lists.contains(categIds, servCategory.key + '-' + oneCateg.key + '-' + categ.key)}"
                                                           th:title="${categ.value}">
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="layui-form-item item-submit">
                    <div class="layui-input-block" style="margin-left: 139px"
                         th:if="${#authPermit.checkPermit('/pilot/channel/price/addEditView.action')}">
                        <button class="layui-btn" lay-submit="" lay-filter="zmn-form-submit">提交</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>

        </div>

    </div>

</div>
</body>
</html>

<script type="text/javascript" th:inline="javascript">
    var json = {
        currentServCategId: [[${currentServCategId}]],
    };

    layui.config({
        base: "/static/lay/",
        version: 201910241646
    }).extend({
        index: "lib/index",
        channel_price_category: "pilot/zmn.plat.channel.price.category",
    }).use(['index', 'channel_price_category']);

</script>
